OUTPUT=output
CP=cp
GCC=g++ -g
LIBS += -lGLU -lGL -L../libs -lSDL_image -lSDL_ttf -lSDL -lSDLmain
INC_DIRS = -I../common

vpath %.cpp CubePuzzle 
vpath %.h CubePuzzle 
vpath %.cpp ../common 
vpath %.h ../common

SRC_FILES = main.cpp	\
			puzzle.cpp	\
			texture.cpp	\
			TTFFont.cpp	\
			TextObject.cpp	\
			GLui.cpp	\
			GLButton.cpp	\
			GLMessageBox.cpp
			

HEADER_FILES = puzzle.h	\
				texture.h	\
				TTFFont.h	\
				TextObject.h	\
				GLui.h	\
				GLButton.h	\
				GLMessageBox.h	

OBJ_FILES = $(patsubst %.cpp,.%.o,$(SRC_FILES))

.%.o: %.cpp
	$(GCC) -c $< -o $@ $(INC_DIRS)

$(OUTPUT):$(OBJ_FILES)
	$(GCC) -o $(OUTPUT) $(OBJ_FILES) $(LIBS)
	ln -sf CubePuzzle/images .
	ln -sf CubePuzzle/fonts .

$(OBJ_FILES): $(HEADER_FILES)

.PHONEY clean:
	rm -vf .*.o
	rm -vf $(OUTPUT)
	rm -fv images
	rm -fv fonts
